/**
 * 
 */
package com.itinsys.enma.dao;

import java.util.Date;
import java.util.List;

import com.itinsys.enma.domain.Period;
import com.itinsys.enma.domain.Planning;
import com.itinsys.enma.exception.period.PeriodExistsException;

/**
 * @author pferraz
 *
 */
public interface PeriodDAO {

	Boolean addPeriod(Period p);

	Boolean updatePeriod(Period p);

	Period getById(long id) throws PeriodExistsException;

	Period getPeriodByStartDateAndEndDate(Date startDate, Date endDate) throws PeriodExistsException;

	List<Period> getNotSpecialPeriods() throws PeriodExistsException;

	Period getPeriodByDatePlannIdAndSubject(java.sql.Date startDate,java.sql.Date endDate, int pId, String description) throws PeriodExistsException;

	List<Planning> getPlanningsByPeriod(long id);

	Boolean deletePeriod(Period period);

	List<Period> getReservationsToEnd(String date) throws PeriodExistsException;

	void directUpdate(Period period);

	List<Period> getAllLocks() throws PeriodExistsException;

	boolean lockControl();

}
